Factoring Quadratic Form